﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Twitter.offline
{
    public partial class DisplayTweets : System.Web.UI.Page
    {

        public int userId
        {
            set;
            get;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            userId = Int32.Parse(Request.Params["userid"]);
            if (Request.Params["delete"] != null)
            {
                Util util = new Util();
                Tweet tw = new Tweet();
                tw.ID = Int32.Parse(Request.Params["delete"]);
                util.deleteTweet(tw);
            }
        }

        public IEnumerable<Twitter.Tweet> getUserTweets()
        {
            Util util = new Util();
            User user = new User();
            user.ID = userId;
            return util.findAllUserTweet(user);
        }


    }
}